package cn.iocoder.yudao.module.research.dal.mysql.syslog;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.research.dal.dataobject.syslog.SyslogDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.research.controller.admin.syslog.vo.*;

/**
 * syslog Mapper
 *
 * @author cai
 */
@Mapper
public interface SyslogMapper extends BaseMapperX<SyslogDO> {

    default PageResult<SyslogDO> selectPage(SyslogPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<SyslogDO>()
                .eqIfPresent(SyslogDO::getContent, reqVO.getContent())
                .eqIfPresent(SyslogDO::getAiResponse, reqVO.getAiResponse())
                .eqIfPresent(SyslogDO::getStatus, reqVO.getStatus())
                .eqIfPresent(SyslogDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(SyslogDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(SyslogDO::getId));
    }

}